package com.powernode.dataservice.mapper;

import com.powernode.api.model.User;

public interface UserMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(User record);

    int insertSelective(User record);

    User selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);

    /**
     * 返回总人数
     * @return
     */
    Integer selectCountUser();

    /**
     * 通过手机号码 查询 用户
     * @param phone 手机号码
     * @return 用户对象
     */
    User selectUserByPhone(String phone);

    /**
     * 添加用户表  返回主键 id
     * @param user
     * @return
     */
//    @Insert("")
//    @Options(useGeneratedKeys = true,keyColumn = "",keyProperty = "")
    int insertUserReturnId(User user);


    /**
     * 登录查询
     * @param phone  手机号码
     * @param password  密码
     * @return
     */
    User selectLogin(String phone, String password);

}